<template>
  <div class="I-IV-I">
    <!-- （一）赴境外交流学习学生情况 -->
    <table class="I-IV-I__tableone">
      <tr class="I-IV-I__tableone-trone">
        <td class="I-IV-I__tableone-trone-td"
            colspan="7">
          <div class="I-IV-I__tableone-trone-td-title">
            I-4 学生国际交流情况
          </div>
        </td>
      </tr>
      <tr class="I-IV-I__tableone-trtwo">
        <td class="I-IV-I__tableone-trtwo-td"
            colspan="7">
          <div class="I-IV-I__tableone-trtwo-td-title">
            （一）赴境外交流学习学生情况
          </div>
        </td>
      </tr>
      <tr class="I-IV-I__tableone-trthree">
        <td class="I-IV-I__tableone-trthree-tdone"
            rowspan="3">
          年度
        </td>
        <td class="I-IV-I__tableone-trthree-tdtwo"
            colspan="2">
          在校生总数
        </td>
        <td class="I-IV-I__tableone-trthree-tdthree"
            colspan="4">
          赴境外交流学生
          <span class="I-IV-I__tableone-trthree-tdthree-tips">
            （人数及比例）
          </span>
        </td>
      </tr>
      <tr class="I-IV-I__tableone-trfour">
        <td class="I-IV-I__tableone-trfour-tdone"
            rowspan="2">
          博士
        </td>
        <td class="I-IV-I__tableone-trfour-tdtwo"
            rowspan="2">
          硕士
        </td>
        <td class="I-IV-I__tableone-trfour-tdthree"
            rowspan="2">
          博士
        </td>
        <td class="I-IV-I__tableone-trfour-tdfour"
            rowspan="2">
          硕士
        </td>
        <td class="I-IV-I__tableone-trfour-tdfive"
            colspan="2">
          其中：国家留学基金委资助人数
        </td>
      </tr>
      <tr class="I-IV-I__tableone-trfive">
        <td class="I-IV-I__tableone-trfive-tdone">
          博士
        </td>
        <td class="I-IV-I__tableone-trfive-tdtwo">
          硕士
        </td>
      </tr>
      <tr v-for="(item, index) in ada.thisDis.exchangeInfos"
          :key="index"
          class="I-IV-I__tableone-trother">
        <td class="I-IV-I__tableone-trother-tdone">
          {{ item.year }}
        </td>
        <td class="I-IV-I__tableone-trother-tdleft">
          <el-input v-model="item.doctorNum"
                    class="I-IV-I__tableone-trthree-tdone-input"
                    type="input"
                    placeholder="10"
                    :maxlength="5"/>
        </td>
        <td class="I-IV-I__tableone-trother-tdleft">
          <el-input v-model="item.masterNum"
                    type="input"
                    placeholder="20"
                    :maxlength="5"/>
        </td>
        <td class="I-IV-I__tableone-trother-tdright">
          <el-input v-model="item.exchangeDoctorNum"
                    type="input"
                    placeholder="5"
                    :maxlength="5"
                    class="I-IV-I__tableone-trother-tdright-input">
            <template slot="append">
              ({{ item.doctorNum + 0 == 0 ? item.exchangeDoctorRatio = '0.0' : getRatio(item.doctorNum, item.exchangeDoctorNum, 'exchangeDoctorRatio', index) }}%)
            </template>
          </el-input>
        </td>
        <td class="I-IV-I__tableone-trother-tdright">
          <el-input v-model="item.exchangeMasterNum"
                    type="input"
                    placeholder="10"
                    :maxlength="5"
                    class="I-IV-I__tableone-trother-tdright-input">
            <template slot="append">
              ({{ item.masterNum + 0 == 0 ? item.exchangeMasterRatio = '0.0' : getRatio(item.masterNum, item.exchangeMasterNum, 'exchangeMasterRatio', index) }}%)
            </template>
          </el-input>
        </td>
        <td class="I-IV-I__tableone-trother-tdright">
          <el-input v-model="item.countryDocterNum"
                    type="input"
                    placeholder="3"
                    :maxlength="5"
                    class="I-IV-I__tableone-trother-tdright-input">
            <template slot="append">
              ({{ item.doctorNum + 0 == 0 ? item.countryDoctorRatio = '0.0' : getRatio(item.doctorNum, item.countryDocterNum, 'countryDoctorRatio', index) }}%)
            </template>
          </el-input>
        </td>
        <td class="I-IV-I__tableone-trother-tdright">
          <el-input v-model="item.countryMasterNum"
                    type="input"
                    placeholder="3"
                    :maxlength="5"
                    class="I-IV-I__tableone-trother-tdright-input">
            <template slot="append">
              ({{ item.masterNum + 0 == 0 ? item.countryMasterRatio = '0.0' : getRatio(item.masterNum, item.countryMasterNum, 'countryMasterRatio', index) }}%)
            </template>
          </el-input>
        </td>
      </tr>
    </table>
    <!-- （二）参加国际学术会议做报告学生情况 -->
    <table class="I-IV-I__tabletwo">
      <tr class="I-IV-I__tabletwo-trone">
        <td class="I-IV-I__tabletwo-trone-td"
            colspan="7">
          <div class="I-IV-I__tabletwo-trone-td-title">
            （二）参加国际学术会议做报告学生情况
            <span class="I-IV-I__tabletwo-trone-td-title-tips">
              （列举20项代表性国际学术会议报告）
            </span>
          </div>
        </td>
      </tr>
      <tr class="I-IV-I__tabletwo-trtwo">
        <td class="I-IV-I__tabletwo-trtwo-tdone"
            rowspan="2">
          会议地点
        </td>
        <td class="I-IV-I__tabletwo-trtwo-tdtwo"
            colspan="6">
          参加国际学术会议并做口头报告的学生人次
        </td>
      </tr>
      <tr class="I-IV-I__tabletwo-trthree">
        <td v-for="(item,index) in 5"
            :key="index"
            class="I-IV-I__tabletwo-trthree-td">
          {{ thisYear - 5 + index }}年
        </td>
        <td class="I-IV-I__tabletwo-trthree-tdtotal">
          总计
        </td>
      </tr>
      <tr class="I-IV-I__tabletwo-trfour">
        <td class="I-IV-I__tabletwo-trfour-tdone">
          境内
        </td>
        <td v-for="(item, index) in ada.thisDis.meetingInfo.meetCounts[0].stuNumInfos"
            :key="index"
            class="I-IV-I__tabletwo-trfour-tdother">
          <el-input v-model="item.stuNum"
                    class="I-IV-I__tabletwo-trfour-tdother-input"
                    type="input"
                    placeholder="10"
                    :maxlength="5"/>
        </td>
        <td class="I-IV-I__tabletwo-trfour-tdother">
          <el-input v-model="ada.thisDis.meetingInfo.meetCounts[0].total"
                    class="I-IV-I__tabletwo-trfour-tdother-input"
                    type="input"
                    readonly
                    placeholder="0"
                    :maxlength="5"/>
        </td>
      </tr>
      <tr class="I-IV-I__tabletwo-trfive">
        <td class="I-IV-I__tabletwo-trfive-tdone">
          境外
        </td>
        <td v-for="(item, index) in ada.thisDis.meetingInfo.meetCounts[1].stuNumInfos"
            :key="index"
            class="I-IV-I__tabletwo-trfive-tdother">
          <el-input v-model="item.stuNum"
                    class="I-IV-I__tabletwo-trfive-tdother-input"
                    type="input"
                    placeholder="10"
                    :maxlength="5"/>
        </td>
        <td class="I-IV-I__tabletwo-trfive-tdother">
          <el-input v-model="ada.thisDis.meetingInfo.meetCounts[1].total"
                    class="I-IV-I__tabletwo-trfive-tdother-input"
                    type="input"
                    readonly
                    placeholder="0"
                    :maxlength="5"/>
        </td>
      </tr>
    </table>
    <table class="I-IV-I__tablethree">
      <tr class="I-IV-I__tablethree-th">
        <td class="I-IV-I__tablethree-th-tdone">
          序号
        </td>
        <td class="I-IV-I__tablethree-th-tdtwo">
          口头报告名称
        </td>
        <td class="I-IV-I__tablethree-th-tdthree">
          会议名称及地点
        </td>
        <td class="I-IV-I__tablethree-th-tdfour">
          报告时间
        </td>
        <td class="I-IV-I__tablethree-th-tdfive">
          报告人
        </td>
        <td class="I-IV-I__tablethree-th-tdsix">
          报告类型
        </td>
        <el-button type="success"
                   size="small"
                   icon="el-icon-plus"
                   class="I-IV-I__tablethree-th-add-button"
                   circle
                   @click.prevent="addReportList"/>
      </tr>
      <tr v-for="(item, index) in ada.thisDis.meetingInfo.conferInfos"
          :key="index"
          class="I-IV-I__tablethree-tr">
        <td class="I-IV-I__tablethree-tr-tdone">
          {{ index + 1 }}
        </td>
        <td class="I-IV-I__tablethree-tr-tdtwo">
          <el-input
            v-model="item.reportName"
            type="textarea"
            autosize
            placeholder="XXXXX"
            :maxlength="200"/>
        </td>
        <td class="I-IV-I__tablethree-tr-tdthree">
          <el-input
            v-model="item.conferNamePlace"
            type="textarea"
            autosize
            placeholder="XXXX，法国巴黎"
            :maxlength="200"/>
        </td>
        <td class="I-IV-I__tablethree-tr-tdfour">
          <el-input
            v-model="item.reportTime"
            type="textarea"
            autosize
            placeholder="202110"
            :maxlength="20"/>
        </td>
        <td class="I-IV-I__tablethree-tr-tdfive">
          <el-input
            v-model="item.reporter"
            type="textarea"
            autosize
            placeholder="张艺兴"
            :maxlength="100"/>
        </td>
        <td class="I-IV-I__tablethree-tr-tdsix">
          <el-select v-model="item.reportType"
                     class="I-IV-I__tablethree-tr-tdsix-select"
                     placeholder="请选择">
            <el-option v-for="item in options"
                       :key="item.value"
                       :label="item.label"
                       :value="item.value"/>
          </el-select>
        </td>
        <el-button type="danger"
                   size="small"
                   icon="el-icon-delete"
                   class="I-IV-I__tablethree-tr-delete-button"
                   circle
                   @click.prevent="deleteReportItem(index)"/>
      </tr>
    </table>
    <!-- （三）赴境外参加其他学术活动情况 -->
    <table class="I-IV-I__tablefour">
      <tr class="I-IV-I__tablefour-trone">
        <td class="I-IV-I__tablefour-trone-td">
          <div class="I-IV-I__tablefour-trone-td-title">
            （三）赴境外参加其他学术活动情况
            <span class="I-IV-I__tablefour-trone-td-title-tips">
              （限300字）
            </span>
          </div>
        </td>
      </tr>
      <tr class="I-IV-I__tablefour-trtwo">
        <td class="I-IV-I__tablefour-trtwo-td">
          <el-input v-model="ada.thisDis.otherSituation"
                    type="textarea"
                    :autosize="{ minRows: 6 }"
                    showWordLimit
                    placeholder="请输入赴境外参加其他学术活动情况"
                    :maxlength="300"
                    class="two_indent"/>
        </td>
      </tr>
    </table>
    <!-- （四）来华留学生情况 -->
    <table class="I-IV-I__tablefive">
      <tr class="I-IV-I__tablefive-trone">
        <td class="I-IV-I__tablefive-trone-td"
            colspan="7">
          <div class="I-IV-I__tablefive-trone-td-title">
            （四）来华留学生情况
            <span class="I-IV-I__tablefive-trone-td-title-tips">
              （人数及比例）
            </span>
          </div>
        </td>
      </tr>
      <tr class="I-IV-I__tablefive-trtwo">
        <td class="I-IV-I__tablefive-trtwo-tdone"
            rowspan="2">
          主要来源<br>国家（地区）
        </td>
        <td v-for="(item, index) in ada.thisDis.foreignStuInfo.countrys.slice(0, 5)"
            :key="index"
            class="I-IV-I__tablefive-trtwo-tdtwo">
          <el-input v-model="item.place"
                    type="textarea"
                    autosize
                    placeholder="请输入国家名"
                    :maxlength="50"/>
        </td>
        <td class="I-IV-I__tablefive-trtwo-tdlast">
          其他国家<br>（地区）
        </td>
      </tr>
      <tr class="I-IV-I__tablefive-trthree">
        <td v-for="(item, index) in ada.thisDis.foreignStuInfo.countrys"
            :key="index"
            class="I-IV-I__tablefive-trthree-td">
          <el-input v-model="item.number"
                    type="input"
                    placeholder="5"
                    :maxlength="5"
                    class="I-IV-I__tablefive-trtwo-tdtwo-input">
            <template slot="append">
              ({{ item.ratio }}%)
            </template>
          </el-input>
        </td>
      </tr>
      <tr class="I-IV-I__tablefive-trfour">
        <td class="I-IV-I__tablefive-trfour-tdone"
            rowspan="2">
          主要来源高校<br>
          <span class="I-IV-I__tablefive-trfour-tdone-tips">
            （前置学位）
          </span>
        </td>
        <td v-for="(item, index) in ada.thisDis.foreignStuInfo.schools.slice(0, 5)"
            :key="index"
            class="I-IV-I__tablefive-trtwo-tdtwo">
          <el-input v-model="item.place"
                    type="textarea"
                    autosize
                    placeholder="请输入高校名"
                    :maxlength="50"/>
        </td>
        <td class="I-IV-I__tablefive-trtwo-tdlast">
          其他高校
        </td>
      </tr>
      <tr class="I-IV-I__tablefive-trfive">
        <td v-for="(item, index) in ada.thisDis.foreignStuInfo.schools"
            :key="index"
            class="I-IV-I__tablefive-trfive-td">
          <el-input v-model="item.number"
                    type="input"
                    placeholder="5"
                    :maxlength="5"
                    class="I-IV-I__tablefive-trtwo-tdtwo-input">
            <template slot="append">
              ({{ item.ratio }}%)
            </template>
          </el-input>
        </td>
      </tr>
    </table>
    <!-- 说明 -->
    <div class="I-IV-I__explain">
      <span class="I-IV-I__explain-strong">
        说明：①
      </span>
      本表填写赴境外（含港澳台地区）交流学习、参加国际会议或学术活动以及来华留学生情况。
      <span class="I-IV-I__explain-strong">
        ②
      </span>
      表（一）填写赴境外联合培养或攻读学位的博士和硕士研究生（不含同等学力申请博士和硕士人员、留学生、中外合作办学机构和项目的学生），截至2020年12月31日在境外连续时长不少于3个月，出境时间应在2015年10月1日之后。
      <span class="I-IV-I__explain-strong">
        ③
      </span>
      同一学生在同一学习阶段（硕士或博士）只统计一次。
      <span class="I-IV-I__explain-strong">
        ④
      </span>
      “在校生数”指具有学籍并在各学年9月1日进行学籍注册的全日制研究生数。
      <span class="I-IV-I__explain-strong">
        ⑤
      </span>
      “报告类型”限填“大会报告、分会报告”。
      <span class="I-IV-I__explain-strong">
        ⑥
      </span>
      表（四）填写来华留学人数最多的5个国家（地区）或高校分布情况，仅统计学位生，不含学历生、交换生、交流生、预科生和语言培训学生。
      <span class="I-IV-I__explain-strong">
        ⑦
      </span>
      可根据学科特点和实际情况，自主选择填写与本学科相近的一个专业学位类别的研究生；请注明专业学位类别，并在“选填说明”栏中注明选填该专业学位的主要考虑。
    </div>
    <!-- 专业学位学生国际交流情况 -->
    <table class="I-IV-I__tablesix">
      <tr class="I-IV-I__tablesix-trone">
        <td class="I-IV-I__tablesix-trone-tdone"
            colspan="2">
          专业学位学生国际交流情况
          <span class="I-IV-I__tablesix-trone-tdone-tips">
            （选填）
          </span>
        </td>
        <td class="I-IV-I__tablesix-trone-tdtwo">
          专业学位类别
        </td>
        <td class="I-IV-I__tablesix-trone-tdthree">
          <el-input v-model="ada.otherDis.professInfo.degreeCategory"
                    type="textarea"
                    autosize
                    placeholder="请输入专业学位类别"
                    :maxlength="20"/>
        </td>
      </tr>
      <tr class="I-IV-I__tablesix-trtwo">
        <td class="I-IV-I__tablesix-trtwo-tdone">
          选填说明<br>
          <span class="I-IV-I__tablesix-trtwo-tdone-tips">
            （限50字）
          </span>
        </td>
        <td class="I-IV-I__tablesix-trtwo-tdtwo"
            colspan="3">
          <el-input v-model="ada.otherDis.professInfo.description"
                    type="textarea"
                    :autosize="{ minRows: 6 }"
                    showWordLimit
                    placeholder="请输入选填说明情况"
                    :maxlength="50"
                    class="two_indent"/>
        </td>
      </tr>
    </table>
    <!-- <br> -->
    <!-- 选修表一 -->
    <table class="I-IV-I__tableone_repead">
      <tr class="I-IV-I__tableone-retrtwo">
        <td class="I-IV-I__tableone-trtwo-td"
            colspan="7">
          <div class="I-IV-I__tableone-trtwo-td-title">
            （一）赴境外交流学习学生情况
          </div>
        </td>
      </tr>
      <tr class="I-IV-I__tableone-trthree">
        <td class="I-IV-I__tableone-trthree-tdone"
            rowspan="3">
          年度
        </td>
        <td class="I-IV-I__tableone-trthree-tdtwo"
            colspan="2">
          在校生总数
        </td>
        <td class="I-IV-I__tableone-trthree-tdthree"
            colspan="4">
          赴境外交流学生
          <span class="I-IV-I__tableone-trthree-tdthree-tips">
            （人数及比例）
          </span>
        </td>
      </tr>
      <tr class="I-IV-I__tableone-trfour">
        <td class="I-IV-I__tableone-trfour-tdone"
            rowspan="2">
          博士
        </td>
        <td class="I-IV-I__tableone-trfour-tdtwo"
            rowspan="2">
          硕士
        </td>
        <td class="I-IV-I__tableone-trfour-tdthree"
            rowspan="2">
          博士
        </td>
        <td class="I-IV-I__tableone-trfour-tdfour"
            rowspan="2">
          硕士
        </td>
        <td class="I-IV-I__tableone-trfour-tdfive"
            colspan="2">
          其中：国家留学基金委资助人数
        </td>
      </tr>
      <tr class="I-IV-I__tableone-trfive">
        <td class="I-IV-I__tableone-trfive-tdone">
          博士
        </td>
        <td class="I-IV-I__tableone-trfive-tdtwo">
          硕士
        </td>
      </tr>
      <tr v-for="(item, index) in ada.otherDis.otherDisAda.exchangeInfos"
          :key="index"
          class="I-IV-I__tableone-trother">
        <td class="I-IV-I__tableone-trother-tdone">
          {{ item.year }}
        </td>
        <td class="I-IV-I__tableone-trother-tdleft">
          <el-input v-model="item.doctorNum"
                    class="I-IV-I__tableone-trthree-tdone-input"
                    type="input"
                    placeholder="10"
                    :maxlength="5"/>
        </td>
        <td class="I-IV-I__tableone-trother-tdleft">
          <el-input v-model="item.masterNum"
                    type="input"
                    placeholder="20"
                    :maxlength="5"/>
        </td>
        <td class="I-IV-I__tableone-trother-tdright">
          <el-input v-model="item.exchangeDoctorNum"
                    type="input"
                    placeholder="5"
                    :maxlength="5"
                    class="I-IV-I__tableone-trother-tdright-input">
            <template slot="append">
              ({{ item.doctorNum + 0 == 0 ? item.exchangeDoctorRatio = '0.0' : getRatio(item.doctorNum, item.exchangeDoctorNum, 'exchangeDoctorRatio', index) }}%)
            </template>
          </el-input>
        </td>
        <td class="I-IV-I__tableone-trother-tdright">
          <el-input v-model="item.exchangeMasterNum"
                    type="input"
                    placeholder="10"
                    :maxlength="5"
                    class="I-IV-I__tableone-trother-tdright-input">
            <template slot="append">
              ({{ item.masterNum + 0 == 0 ? item.exchangeMasterRatio = '0.0' : getRatio(item.masterNum, item.exchangeMasterNum, 'exchangeMasterRatio', index) }}%)
            </template>
          </el-input>
        </td>
        <td class="I-IV-I__tableone-trother-tdright">
          <el-input v-model="item.countryDocterNum"
                    type="input"
                    placeholder="3"
                    :maxlength="5"
                    class="I-IV-I__tableone-trother-tdright-input">
            <template slot="append">
              ({{ item.doctorNum + 0 == 0 ? item.countryDoctorRatio = '0.0' : getRatio(item.doctorNum, item.countryDocterNum, 'countryDoctorRatio', index) }}%)
            </template>
          </el-input>
        </td>
        <td class="I-IV-I__tableone-trother-tdright">
          <el-input v-model="item.countryMasterNum"
                    type="input"
                    placeholder="3"
                    :maxlength="5"
                    class="I-IV-I__tableone-trother-tdright-input">
            <template slot="append">
              ({{ item.masterNum + 0 == 0 ? item.countryMasterRatio = '0.0' : getRatio(item.masterNum, item.countryMasterNum, 'countryMasterRatio', index) }}%)
            </template>
          </el-input>
        </td>
      </tr>
    </table>
    <!-- （二）参加国际学术会议做报告学生情况 -->
    <table class="I-IV-I__tabletwo">
      <tr class="I-IV-I__tabletwo-trone">
        <td class="I-IV-I__tabletwo-trone-td"
            colspan="7">
          <div class="I-IV-I__tabletwo-trone-td-title">
            （二）参加国际学术会议做报告学生情况
            <span class="I-IV-I__tabletwo-trone-td-title-tips">
              （列举20项代表性国际学术会议报告）
            </span>
          </div>
        </td>
      </tr>
      <tr class="I-IV-I__tabletwo-trtwo">
        <td class="I-IV-I__tabletwo-trtwo-tdone"
            rowspan="2">
          会议地点
        </td>
        <td class="I-IV-I__tabletwo-trtwo-tdtwo"
            colspan="6">
          参加国际学术会议并做口头报告的学生人次
        </td>
      </tr>
      <tr class="I-IV-I__tabletwo-trthree">
        <td v-for="(item,index) in 5"
            :key="index"
            class="I-IV-I__tabletwo-trthree-td">
          {{ thisYear - 5 + index }}年
        </td>
        <td class="I-IV-I__tabletwo-trthree-tdtotal">
          总计
        </td>
      </tr>
      <tr class="I-IV-I__tabletwo-trfour">
        <td class="I-IV-I__tabletwo-trfour-tdone">
          境内
        </td>
        <td v-for="(item, index) in ada.otherDis.otherDisAda.meetingInfo.meetCounts[0].stuNumInfos"
            :key="index"
            class="I-IV-I__tabletwo-trfour-tdother">
          <el-input v-model="item.stuNum"
                    class="I-IV-I__tabletwo-trfour-tdother-input"
                    type="input"
                    placeholder="10"
                    :maxlength="5"/>
        </td>
        <td class="I-IV-I__tabletwo-trfour-tdother">
          <el-input v-model="ada.otherDis.otherDisAda.meetingInfo.meetCounts[0].total"
                    class="I-IV-I__tabletwo-trfour-tdother-input"
                    type="input"
                    readonly
                    placeholder="0"
                    :maxlength="5"/>
        </td>
      </tr>
      <tr class="I-IV-I__tabletwo-trfive">
        <td class="I-IV-I__tabletwo-trfive-tdone">
          境外
        </td>
        <td v-for="(item, index) in ada.otherDis.otherDisAda.meetingInfo.meetCounts[1].stuNumInfos"
            :key="index"
            class="I-IV-I__tabletwo-trfive-tdother">
          <el-input v-model="item.stuNum"
                    class="I-IV-I__tabletwo-trfive-tdother-input"
                    type="input"
                    placeholder="10"
                    :maxlength="5"/>
        </td>
        <td class="I-IV-I__tabletwo-trfive-tdother">
          <el-input v-model="ada.otherDis.otherDisAda.meetingInfo.meetCounts[1].total"
                    class="I-IV-I__tabletwo-trfive-tdother-input"
                    type="input"
                    readonly
                    placeholder="0"
                    :maxlength="5"/>
        </td>
      </tr>
    </table>
    <table class="I-IV-I__tablethree">
      <tr class="I-IV-I__tablethree-th">
        <td class="I-IV-I__tablethree-th-tdone">
          序号
        </td>
        <td class="I-IV-I__tablethree-th-tdtwo">
          口头报告名称
        </td>
        <td class="I-IV-I__tablethree-th-tdthree">
          会议名称及地点
        </td>
        <td class="I-IV-I__tablethree-th-tdfour">
          报告时间
        </td>
        <td class="I-IV-I__tablethree-th-tdfive">
          报告人
        </td>
        <td class="I-IV-I__tablethree-th-tdsix">
          报告类型
        </td>
        <el-button type="success"
                   size="small"
                   icon="el-icon-plus"
                   class="I-IV-I__tablethree-th-add-button"
                   circle
                   @click.prevent="addReportListre"/>
      </tr>
      <tr v-for="(item, index) in ada.otherDis.otherDisAda.meetingInfo.conferInfos"
          :key="index"
          class="I-IV-I__tablethree-tr">
        <td class="I-IV-I__tablethree-tr-tdone">
          {{ index + 1 }}
        </td>
        <td class="I-IV-I__tablethree-tr-tdtwo">
          <el-input
            v-model="item.reportName"
            type="textarea"
            autosize
            placeholder="XXXXX"
            :maxlength="20"/>
        </td>
        <td class="I-IV-I__tablethree-tr-tdthree">
          <el-input
            v-model="item.conferNamePlace"
            type="textarea"
            autosize
            placeholder="XXXX，法国巴黎"
            :maxlength="20"/>
        </td>
        <td class="I-IV-I__tablethree-tr-tdfour">
          <el-input
            v-model="item.reportTime"
            type="textarea"
            autosize
            placeholder="202110"
            :maxlength="6"/>
        </td>
        <td class="I-IV-I__tablethree-tr-tdfive">
          <el-input
            v-model="item.reporter"
            type="textarea"
            autosize
            placeholder="张艺兴"
            :maxlength="20"/>
        </td>
        <td class="I-IV-I__tablethree-tr-tdsix">
          <el-select v-model="item.reportType"
                     class="I-IV-I__tablethree-tr-tdsix-select"
                     placeholder="请选择">
            <el-option v-for="item in options"
                       :key="item.value"
                       :label="item.label"
                       :value="item.value"/>
          </el-select>
        </td>
        <el-button type="danger"
                   size="small"
                   icon="el-icon-delete"
                   class="I-IV-I__tablethree-tr-delete-button"
                   circle
                   @click.prevent="deleteReportItemre(index)"/>
      </tr>
    </table>
    <!-- （三）赴境外参加其他学术活动情况 -->
    <table class="I-IV-I__tablefour">
      <tr class="I-IV-I__tablefour-trone">
        <td class="I-IV-I__tablefour-trone-td">
          <div class="I-IV-I__tablefour-trone-td-title">
            （三）赴境外参加其他学术活动情况
            <span class="I-IV-I__tablefour-trone-td-title-tips">
              （限300字）
            </span>
          </div>
        </td>
      </tr>
      <tr class="I-IV-I__tablefour-trtwo">
        <td class="I-IV-I__tablefour-trtwo-td">
          <el-input v-model="ada.otherDis.otherDisAda.otherSituation"
                    type="textarea"
                    :autosize="{ minRows: 6 }"
                    showWordLimit
                    placeholder="请输入赴境外参加其他学术活动情况"
                    :maxlength="300"
                    class="two_indent"/>
        </td>
      </tr>
    </table>
    <!-- （四）来华留学生情况 -->
    <table class="I-IV-I__tablefive">
      <tr class="I-IV-I__tablefive-trone">
        <td class="I-IV-I__tablefive-trone-td"
            colspan="7">
          <div class="I-IV-I__tablefive-trone-td-title">
            （四）来华留学生情况
            <span class="I-IV-I__tablefive-trone-td-title-tips">
              （人数及比例）
            </span>
          </div>
        </td>
      </tr>
      <tr class="I-IV-I__tablefive-trtwo">
        <td class="I-IV-I__tablefive-trtwo-tdone"
            rowspan="2">
          主要来源<br>国家（地区）
        </td>
        <td v-for="(item, index) in ada.otherDis.otherDisAda.foreignStuInfo.countrys.slice(0, 5)"
            :key="index"
            class="I-IV-I__tablefive-trtwo-tdtwo">
          <el-input v-model="item.place"
                    type="textarea"
                    autosize
                    placeholder="请输入国家名"
                    :maxlength="20"/>
        </td>
        <td class="I-IV-I__tablefive-trtwo-tdlast">
          其他国家<br>（地区）
        </td>
      </tr>
      <tr class="I-IV-I__tablefive-trthree">
        <td v-for="(item, index) in ada.otherDis.otherDisAda.foreignStuInfo.countrys"
            :key="index"
            class="I-IV-I__tablefive-trthree-td">
          <el-input v-model="item.number"
                    type="input"
                    placeholder="5"
                    :maxlength="5"
                    class="I-IV-I__tablefive-trtwo-tdtwo-input">
            <template slot="append">
              ({{ item.ratio }}%)
            </template>
          </el-input>
        </td>
      </tr>
      <tr class="I-IV-I__tablefive-trfour">
        <td class="I-IV-I__tablefive-trfour-tdone"
            rowspan="2">
          主要来源高校<br>
          <span class="I-IV-I__tablefive-trfour-tdone-tips">
            （前置学位）
          </span>
        </td>
        <td v-for="(item, index) in ada.otherDis.otherDisAda.foreignStuInfo.schools.slice(0, 5)"
            :key="index"
            class="I-IV-I__tablefive-trtwo-tdtwo">
          <el-input v-model="item.place"
                    type="textarea"
                    autosize
                    placeholder="请输入高校名"
                    :maxlength="20"/>
        </td>
        <td class="I-IV-I__tablefive-trtwo-tdlast">
          其他高校
        </td>
      </tr>
      <tr class="I-IV-I__tablefive-trfive">
        <td v-for="(item, index) in ada.otherDis.otherDisAda.foreignStuInfo.schools"
            :key="index"
            class="I-IV-I__tablefive-trfive-td">
          <el-input v-model="item.number"
                    type="input"
                    placeholder="5"
                    :maxlength="5"
                    class="I-IV-I__tablefive-trtwo-tdtwo-input">
            <template slot="append">
              ({{ item.ratio }}%)
            </template>
          </el-input>
        </td>
      </tr>
    </table>
  </div>
</template>

<script>
import { getPageData, toDecimal } from '@/utils/getData.js'
import moment from 'moment'

export default {
  computed: {
    country_total () {
      return this.getSum(this.ada.thisDis.foreignStuInfo.countrys, 'number')
    },
    country_totalre () {
      return this.getSum(this.ada.otherDis.otherDisAda.foreignStuInfo.countrys, 'number')
    },
    school_total () {
      return this.getSum(this.ada.thisDis.foreignStuInfo.schools, 'number')
    },
    school_totalre () {
      return this.getSum(this.ada.otherDis.otherDisAda.foreignStuInfo.schools, 'number')
    }
  },
  watch: {
    ada: {
      handler (newVal) {
        sessionStorage['this_data'] = JSON.stringify(newVal)
      },
      deep: true,
      immediate: true
    },
    'ada.thisDis.meetingInfo.meetCounts.0.stuNumInfos': {
      handler (newVal) {
        this.ada.thisDis.meetingInfo.meetCounts[0].total = this.getSum(newVal, 'stuNum')
      },
      deep: true,
      immediate: true
    },
    'ada.thisDis.meetingInfo.meetCounts.1.stuNumInfos': {
      handler (newVal) {
        this.ada.thisDis.meetingInfo.meetCounts[1].total = this.getSum(newVal, 'stuNum')
      },
      deep: true,
      immediate: true
    },
    'ada.otherDis.otherDisAda.meetingInfo.meetCounts.0.stuNumInfos': {
      handler (newVal) {
        this.ada.otherDis.otherDisAda.meetingInfo.meetCounts[0].total = this.getSum(newVal, 'stuNum')
      },
      deep: true,
      immediate: true
    },
    'ada.otherDis.otherDisAda.meetingInfo.meetCounts.1.stuNumInfos': {
      handler (newVal) {
        this.ada.otherDis.otherDisAda.meetingInfo.meetCounts[1].total = this.getSum(newVal, 'stuNum')
      },
      deep: true,
      immediate: true
    },
    country_total: {
      handler (newVal) {
        for (let i = 0, len = this.ada.thisDis.foreignStuInfo.countrys.length; i < len; i++) {
          this.ada.thisDis.foreignStuInfo.countrys[i].ratio = this.getRatio(newVal, this.ada.thisDis.foreignStuInfo.countrys[i].number)
        }
      }
    },
    country_totalre: {
      handler (newVal) {
        for (let i = 0, len = this.ada.otherDis.otherDisAda.foreignStuInfo.countrys.length; i < len; i++) {
          this.ada.otherDis.otherDisAda.foreignStuInfo.countrys[i].ratio = this.getRatiore(newVal, this.ada.otherDis.otherDisAda.foreignStuInfo.countrys[i].number)
        }
      }
    },
    school_total: {
      handler (newVal) {
        for (let i = 0, len = this.ada.otherDis.otherDisAda.foreignStuInfo.schools.length; i < len; i++) {
          this.ada.thisDis.foreignStuInfo.schools[i].ratio = this.getRatio(newVal, this.ada.thisDis.foreignStuInfo.schools[i].number)
        }
      }
    },
    school_totalre: {
      handler (newVal) {
        for (let i = 0, len = this.ada.otherDis.otherDisAda.foreignStuInfo.schools.length; i < len; i++) {
          this.ada.otherDis.otherDisAda.foreignStuInfo.schools[i].ratio = this.getRatiore(newVal, this.ada.otherDis.otherDisAda.foreignStuInfo.schools[i].number)
        }
      }
    }
  },
  async mounted () {
    const loading = this.$loading({ lock: true, text: '数据获取中...请稍后！', background: 'rgba(0, 0, 0, 0.7)' })

    this.thisYear = moment().year()
    const this_data = await getPageData('ada')
    if (this_data.thisDis && this_data.otherDis) {
      this.ada = this_data
    }
    if (this.ada.thisDis.foreignStuInfo) {
      for (let i = this.ada.thisDis.foreignStuInfo.countrys.length; i < 6; i++) {
        this.ada.thisDis.foreignStuInfo.countrys.push({ number: '', place: '', ratio: '' })
      }
      for (let i = this.ada.thisDis.foreignStuInfo.schools.length; i < 6; i++) {
        this.ada.thisDis.foreignStuInfo.schools.push({ number: '', place: '', ratio: '' })
      }
      this.ada.thisDis.foreignStuInfo.countrys[5].place = '其他国家（地区）'
      this.ada.thisDis.foreignStuInfo.schools[5].place = '高校'
    }
    if (this.ada.otherDis.otherDisAda.foreignStuInfo) {
      for (let i = this.ada.otherDis.otherDisAda.foreignStuInfo.countrys.length; i < 6; i++) {
        this.ada.otherDis.otherDisAda.foreignStuInfo.countrys.push({ number: '', place: '', ratio: '' })
      }
      for (let i = this.ada.otherDis.otherDisAda.foreignStuInfo.schools.length; i < 6; i++) {
        this.ada.otherDis.otherDisAda.foreignStuInfo.schools.push({ number: '', place: '', ratio: '' })
      }
      this.ada.otherDis.otherDisAda.foreignStuInfo.countrys[5].place = '其他国家（地区）'
      this.ada.otherDis.otherDisAda.foreignStuInfo.schools[5].place = '高校'
    }
    this.thisYear = moment().year()
    this.ada.thisDis.exchangeInfos.map((item, index) => {
      item.year = this.thisYear - 5 + index
    })
    this.ada.otherDis.otherDisAda.exchangeInfos.map((item, index) => {
      item.year = this.thisYear - 5 + index
    })
    loading.close()
  },
  data () {
    return {
      options: [
        { value: '0', label: '大会报告' },
        { value: '1', label: '分会报告' }],
      thisYear: '',
      ada: {
        thisDis: {
          exchangeInfos: [
            { year: '', doctorNum: '', masterNum: '', exchangeDoctorNum: '', exchangeDoctorRatio: '', exchangeMasterNum: '', exchangeMasterRatio: '', countryDocterNum: '', countryDocterRatio: '', countryMasterNum: '', countryMasterRatio: '' },
            { year: '', doctorNum: '', masterNum: '', exchangeDoctorNum: '', exchangeDoctorRatio: '', exchangeMasterNum: '', exchangeMasterRatio: '', countryDocterNum: '', countryDocterRatio: '', countryMasterNum: '', countryMasterRatio: '' },
            { year: '', doctorNum: '', masterNum: '', exchangeDoctorNum: '', exchangeDoctorRatio: '', exchangeMasterNum: '', exchangeMasterRatio: '', countryDocterNum: '', countryDocterRatio: '', countryMasterNum: '', countryMasterRatio: '' },
            { year: '', doctorNum: '', masterNum: '', exchangeDoctorNum: '', exchangeDoctorRatio: '', exchangeMasterNum: '', exchangeMasterRatio: '', countryDocterNum: '', countryDocterRatio: '', countryMasterNum: '', countryMasterRatio: '' },
            { year: '', doctorNum: '', masterNum: '', exchangeDoctorNum: '', exchangeDoctorRatio: '', exchangeMasterNum: '', exchangeMasterRatio: '', countryDocterNum: '', countryDocterRatio: '', countryMasterNum: '', countryMasterRatio: '' }
          ],
          foreignStuInfo: {
            countrys: [{ number: '', place: '', ratio: '' }],
            schools: [{ number: '', place: '', ratio: '' }]
          },
          meetingInfo: {
            conferInfos: [
              { conferNamePlace: '', reportName: '', reportTime: '', reportType: '', reporter: '' }
            ],
            meetCounts: [
              { place: '境内', stuNumInfos: [{ stuNum: '', year: this.thisYear - 5 }, { stuNum: '', year: this.thisYear - 4 }, { stuNum: '', year: this.thisYear - 3 }, { stuNum: '', year: this.thisYear - 2 }, { stuNum: '', year: this.thisYear - 1 }], total: '' },
              { place: '境外', stuNumInfos: [{ stuNum: '', year: this.thisYear - 5 }, { stuNum: '', year: this.thisYear - 4 }, { stuNum: '', year: this.thisYear - 3 }, { stuNum: '', year: this.thisYear - 2 }, { stuNum: '', year: this.thisYear - 1 }], total: '' }
            ]
          },
          otherSituation: ''
        },
        otherDis: {
          professInfo: {
            degreeCategory: '',
            description: ''
          },
          otherDisAda: {
            exchangeInfos: [
              { year: '', doctorNum: '', masterNum: '', exchangeDoctorNum: '', exchangeDoctorRatio: '', exchangeMasterNum: '', exchangeMasterRatio: '', countryDocterNum: '', countryDocterRatio: '', countryMasterNum: '', countryMasterRatio: '' },
              { year: '', doctorNum: '', masterNum: '', exchangeDoctorNum: '', exchangeDoctorRatio: '', exchangeMasterNum: '', exchangeMasterRatio: '', countryDocterNum: '', countryDocterRatio: '', countryMasterNum: '', countryMasterRatio: '' },
              { year: '', doctorNum: '', masterNum: '', exchangeDoctorNum: '', exchangeDoctorRatio: '', exchangeMasterNum: '', exchangeMasterRatio: '', countryDocterNum: '', countryDocterRatio: '', countryMasterNum: '', countryMasterRatio: '' },
              { year: '', doctorNum: '', masterNum: '', exchangeDoctorNum: '', exchangeDoctorRatio: '', exchangeMasterNum: '', exchangeMasterRatio: '', countryDocterNum: '', countryDocterRatio: '', countryMasterNum: '', countryMasterRatio: '' },
              { year: '', doctorNum: '', masterNum: '', exchangeDoctorNum: '', exchangeDoctorRatio: '', exchangeMasterNum: '', exchangeMasterRatio: '', countryDocterNum: '', countryDocterRatio: '', countryMasterNum: '', countryMasterRatio: '' }
            ],
            foreignStuInfo: {
              countrys: [{ number: '', place: '', ratio: '' }],
              schools: [{ number: '', place: '', ratio: '' }]
            },
            meetingInfo: {
              conferInfos: [
                { conferNamePlace: '', reportName: '', reportTime: '', reportType: '', reporter: '' }
              ],
              meetCounts: [
                { place: '境内', stuNumInfos: [{ stuNum: '', year: this.thisYear - 5 }, { stuNum: '', year: this.thisYear - 4 }, { stuNum: '', year: this.thisYear - 3 }, { stuNum: '', year: this.thisYear - 2 }, { stuNum: '', year: this.thisYear - 1 }], total: '' },
                { place: '境外', stuNumInfos: [{ stuNum: '', year: this.thisYear - 5 }, { stuNum: '', year: this.thisYear - 4 }, { stuNum: '', year: this.thisYear - 3 }, { stuNum: '', year: this.thisYear - 2 }, { stuNum: '', year: this.thisYear - 1 }], total: '' }
              ]
            },
            otherSituation: ''
          }
        }
      }
    }
  },
  methods: {
    getSum (arr, str) {
      var sum = 0
      if (str) {
        for (let i = 0; i < arr.length; i++) {
          if (arr[i][str] === '') sum += 0
          else sum += parseInt(arr[i][str])
        }
      } else {
        for (let i = 0; i < arr.length; i++) {
          if (arr[i] === '') sum += 0
          else sum += parseInt(arr[i])
        }
      }
      return sum
    },
    getRatio (all, part, type, index) {
      let ratio = '0.0'
      if (all && part) {
        ratio = toDecimal(((part / all).toFixed(3)) * 100)
      }
      if (type) {
        this.ada.thisDis.exchangeInfos[index][type] = ratio
      }
      return ratio
    },
    getRatiore (all, part, type, index) {
      let ratio = '0.0'
      if (all && part) {
        ratio = toDecimal(((part / all).toFixed(3)) * 100)
      }
      if (type) {
        this.ada.otherDis.otherDisAda.exchangeInfos[index][type] = ratio
      }
      return ratio
    },
    addReportList () {
      if (this.ada.thisDis.meetingInfo.conferInfos.length < 20) {
        this.ada.thisDis.meetingInfo.conferInfos.push({ name: '', position: '', date: '', author: '', type: '' })
      }
    },
    addReportListre () {
      if (this.ada.otherDis.otherDisAda.meetingInfo.conferInfos.length < 20) {
        this.ada.otherDis.otherDisAda.meetingInfo.conferInfos.push({ name: '', position: '', date: '', author: '', type: '' })
      }
    },
    deleteReportItem (index) {
      if (this.ada.thisDis.meetingInfo.conferInfos.length > 1) {
        this.ada.thisDis.meetingInfo.conferInfos.splice(index, 1)
      }
    },
    deleteReportItemre (index) {
      if (this.ada.otherDis.otherDisAda.meetingInfo.conferInfos.length > 1) {
        this.ada.otherDis.otherDisAda.meetingInfo.conferInfos.splice(index, 1)
      }
    }
  }
}
</script>

<style lang="less" scoped>
@import '../../assets/css/page/1-4-1.less';
</style>
